package com.rickpan.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * 密码生成工具
 */
public class PasswordGenerator {
    public static void main(String[] args) {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        
        String password = "123456";
        String encoded = encoder.encode(password);
        
        System.out.println("原始密码: " + password);
        System.out.println("加密密码: " + encoded);
        System.out.println("验证结果: " + encoder.matches(password, encoded));
        
        // 生成多个不同的哈希值
        System.out.println("\n生成的BCrypt哈希值:");
        for (int i = 0; i < 3; i++) {
            System.out.println((i+1) + ": " + encoder.encode(password));
        }
    }
}
